home *** CD-ROM | disk | FTP | other *** search
/ QRZ! Ham Radio 8 / QRZ Ham Radio Callsign Database - Volume 8.iso / pc / files / dsp / a56_10sh.z / a56_10sh / a56.h next >
C/C++ Source or Header  |  1996-06-25  |  2KB  |  80 lines

  1. /*******************************************************
  2.  *
  3.  *  a56 - a DSP56001 assembler
  4.  *
  5.  *  Written by Quinn C. Jensen
  6.  *  July 1990
  7.  *  jensenq@npd.novell.com (or jensenq@qcj.icon.com)
  8.  *
  9.  *******************************************************\
  10.  
  11. /*
  12.  * Copyright (C) 1990, 1991 Quinn C. Jensen
  13.  *
  14.  * Permission to use, copy, modify, distribute, and sell this software
  15.  * and its documentation for any purpose is hereby granted without fee,
  16.  * provided that the above copyright notice appear in all copies and
  17.  * that both that copyright notice and this permission notice appear
  18.  * in supporting documentation.  The author makes no representations
  19.  * about the suitability of this software for any purpose.  It is
  20.  * provided "as is" without express or implied warranty.
  21.  *
  22.  */
  23.  
  24. /*
  25.  *  a56.h - general definitions
  26.  *
  27.  */
  28.  
  29. #include <stdio.h>
  30.  
  31. #ifndef TRUE
  32. #define TRUE 1
  33. #define FALSE 0
  34. #define NOT !
  35. typedef int BOOL;
  36. #endif
  37.  
  38. struct sym {
  39.     char *name;
  40.     int val;
  41.     struct sym *next;
  42. } *find_sym();
  43.  
  44. extern int pass;
  45.  
  46. #define NEW(object) ((object *)alloc(sizeof(object)))
  47.  
  48. #define PROG 0
  49. #define XDATA 1
  50. #define YDATA 2
  51. #define LDATA 3
  52.  
  53. #define MAX_NEST 20    /* maximum include file nesting */
  54.  
  55. struct inc {
  56.     char *file;
  57.     FILE *fp;
  58.     int line;
  59. };
  60. extern struct inc inc[];
  61. extern int inc_p;
  62. #define curfile inc[inc_p].file
  63. #define curline inc[inc_p].line
  64.  
  65. struct psect {
  66.     char *name;
  67.     int seg;
  68.     unsigned int pc, bottom, top;
  69.     struct psect *next;
  70. } *find_psect(), *new_psect();
  71.  
  72. FILE *open_read(), *open_write(), *open_append();
  73.  
  74.     /* save string s somewhere */
  75. #define strsave(s) ((s) != NULL ? \
  76.     (char *)strcpy((char *)malloc(strlen(s)+1),(s)) : NULL)
  77.  
  78.     /* after a call to fgets(), remove the newline character */
  79. #define rmcr(s) {if (s[strlen(s)-1] == '\n') s[strlen(s)-1] = '\0';};
  80.